﻿using CleanArchitecture.Core.Configuration;
using CleanArchitecture.Infrastructure.Entities.AdminUsers;
using CleanArchitecture.Infrastructure.Entities.Customers;
using System.Threading.Tasks;

namespace CleanArchitecture.Infrastructure.Interfaces.Authentication
{
    /// <summary>
    /// Authentication service interface
    /// </summary>
    public partial interface IAuthenticationService
    {
        #region AdminUser Authentication Cookie
        /// <summary>
        /// Sign in
        /// </summary>
        /// <param name="user">AdminUserEntity</param>
        /// <param name="isPersistent">Whether the authentication session is persisted across multiple requests</param>
        void SignIn(AdminUser user, bool isPersistent);

        /// <summary>
        /// Sign out
        /// DavidLee 2019/11/20 增加对前端用户登录注销的支持
        /// </summary>
        void SignOut(SignInUserEnum userType = SignInUserEnum.AdminUser);

        /// <summary>
        /// Get authenticated AdminUser
        /// </summary>
        /// <returns>Customer</returns>
        AdminUser GetAuthenticatedAdminUser();
        #endregion

        #region Customer Authentication Jwt
        Customer GetAuthenticatedCustomer();
        /// <summary>
        /// 新增 Jwt token Signin
        /// </summary>
        /// <param name="customer">登录用户</param>
        /// <returns></returns>
        string SignIn(Customer customer);
        
        #endregion
    }
}
